﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Site
{
    public partial class Login : System.Web.UI.Page
    {
        #region variable
        ServiceReference1.Service1Client svc = new ServiceReference1.Service1Client();
        #endregion

        protected void Page_Load(object sender, EventArgs e)
        {
            //if (Session["userSession"] == null)
            //{
            //    Response.Redirect("Login.aspx");
            //}
            tbxUsername.Text = "terry_lim@live.com";
            tbxPassword.Text = "test";
        }

        protected void btnLogin_Click(object sender, EventArgs e)
        {   
            //Session["userSession"] = svc.loginPatient(tbxUsername.Text, tbxPassword.Text);
            List<string> me = svc.siteLoginPatient(tbxUsername.Text, tbxPassword.Text);
            if (me[0] != null)
            {
                Session["userName"] = me[0].ToString();
                Session["userUID"] = me[1].ToString();
                Response.Redirect("ViewProgress.aspx");
            }
        }
    }
}